package org.jeecg.modules.sggg.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.jeecg.modules.sggg.entity.SgBlutdruckRecord;
import org.jeecg.modules.sggg.entity.SgLipidRecord;
import org.jeecg.modules.sggg.entity.SgMember;
import org.jeecg.modules.sggg.mapper.SgLipidRecordMapper;
import org.jeecg.modules.sggg.service.ISgLipidRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Collections;
import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * @Description: 血脂记录表
 * @Author: jeecg-boot
 * @Date: 2022-10-17
 * @Version: V1.0
 */
@Service
public class SgLipidRecordServiceImpl extends ServiceImpl<SgLipidRecordMapper, SgLipidRecord> implements ISgLipidRecordService {

    @Autowired
    private SgLipidRecordMapper lipidRecordMapper;

    @Override
    public IPage<SgMember> queryPageListBySqlxz(Page<SgMember> page, String sysOrgCode,List<String> responsibleAgencies, Integer day, String roleCode, String userId,String name, String phone,boolean Bindstatus,int deviceType) {
        List<SgMember> cronJobLists = lipidRecordMapper.queryPageListBySqlxz(page, sysOrgCode, responsibleAgencies,day, roleCode, userId,name,phone,Bindstatus,deviceType);
        return page.setRecords(cronJobLists);
    }

    @Override
    public IPage<SgLipidRecord> queryList(Page<SgLipidRecord> page, String OrgCode,
                                          SgLipidRecord sgBlutdruckRecord, String roleCode, String userId) {
        return lipidRecordMapper.queryList(page, OrgCode, sgBlutdruckRecord.getMemberId(), sgBlutdruckRecord.getMemberName(), sgBlutdruckRecord.getMemberPhone(),
                sgBlutdruckRecord.getResponsibleAgencies(),sgBlutdruckRecord.getIntervene(), roleCode, userId);
    }

    @Override
    public List<Map<String, Object>> interventionWarning(String orgCode) {
        return lipidRecordMapper.interventionWarning(orgCode);
    }

    @Override
    public List<Map<String, Object>> threeHighNumber(String orgCode) {
        return lipidRecordMapper.threeHighNumber(orgCode);
    }

    @Override
    public IPage<SgLipidRecord> queryListByDoctor(Page<SgLipidRecord> page, String name, String phone,List<String> responsibleAgencies, String sysOrgCode, String roleCode, String doctorId, String intervene) {
        return lipidRecordMapper.queryListByDoctor(page, name, phone,responsibleAgencies, sysOrgCode, roleCode, doctorId, intervene);
    }

    @Override
    public List<SgLipidRecord> dayMeasureNumberCount(String sysOrgCode, String roleCode, String date, String doctorId, String intervene,List<String> responsibleAgencies) {
        return lipidRecordMapper.dayMeasureNumberCount(sysOrgCode, roleCode, date, doctorId, intervene,responsibleAgencies);
    }

    @Override
    public List<SgLipidRecord> dayMeasureNumberCountTwo(String sysOrgCode, String roleCode, String date, String doctorId, String intervene,List<String> responsibleAgencies) {
        return lipidRecordMapper.dayMeasureNumberCountTwo(sysOrgCode, roleCode, date, doctorId, intervene,responsibleAgencies);
    }

    @Override
    public List<Map<String, Integer>> getEachLevelNum(String orgCode) {
        return lipidRecordMapper.getEachLevelNum(orgCode);
    }
}
